#!/bin/bash
#
createDEps()
{
    gnuplot<<EOF

    set terminal postscript eps enhanced color font 'Helvetica,40' linewidth 2\
        dl 8.0
    set output "blastFoam_beamD_validation.eps"
    set xlabel "Time [s]"
    set ylabel "Deflection [m]"
    set grid
    set key right top box
    set size 2,2
#     set autoscale
#     set xrange [0:4]
#     set yrange [0:2.2]
#     set mxtic 4
#     set mytic 4
    plot '<sed -e "s/[(,)]//g" $1/D' using 1:6 title 'blastFoam' \
        with lines lt 1 linewidth 2 lc rgb 'black'


EOF
}

# test if gnuplot exists on the system
if ! which gnuplot > /dev/null 2>&1
then
    echo "gnuplot not found - skipping graph creation" >&2
    exit 1
fi

BLASTFOAM="../postProcessing/probes/0"

createDEps $BLASTFOAM

echo Done
